{include file="include:header" /}
<body class="fixed-sidebar full-height-layout gray-bg" >
    <!-- 会员列表 -->
    <div class="row wrapper border-bottom white-bg page-heading writ-any">
        <div class="col-sm-4">
            <h2>{$title}</h2>
            <!-- 导航部分 -->
            <ol class="breadcrumb">
                <li><a href="{:url('admin/Index/home')}">主页</a></li>
                <li><a href="#">前台设置</a></li>
                <li><strong>{$title}</strong></li>
            </ol>
        </div>
        <div class="col-sm-8">
            <div class="title-action">
                <!-- 链接部分 -->
                <a href="{:url('admin/Front/writ_list')}" class="btn btn-primary">法律文书</a>
            </div> 
        </div>
    </div>
    <!-- 分类列表 -->
    <div class="wrapper wrapper-content ">       
        <!-- 分类列表 -->
        <div class="ibox float-e-margins">
          
                    <div class="ibox-content">
                        <form action="{:url('admin/Adporttwo/writPresent')}"  class="valid-form form-horizontal"  id="uploadForm" enctype="multipart/form-data" method="post">
                            <!-- 基础信息 -->
                            <div class="panel panel-default">
                                <div class="panel-heading">基础信息</div>
                                <div class="panel-body">
                                    <div class="form-group">
                                        <label class="col-sm-2 control-label">文书标题</label>
                                        <div class="col-sm-4 vcheck-abs">
                                            <input type="text" class="form-control" name="w_title"  placeholder="文书标题" datatype="*" errormsg="请输入文书标题" sucmsg=" " value="{$data['w_title']?$data['w_title']:''}"/>
                                        </div>
                                        <p class="text-danger">*必填</p>
                                    </div>

                                    <div class="form-group">
                                        <label class="col-sm-2 control-label">行业</label>
                                        <div class="col-sm-4 vcheck-abs">
                                            <input type="text" class="form-control" name="w_industry"  placeholder="行业" datatype="*" errormsg="请输入行业" sucmsg=" " value="{$data['w_industry']?$data['w_industry']:''}"/>
                                        </div>
                                        <p class="text-danger">*必填</p>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-sm-2 control-label">版权</label>
                                        <div class="col-sm-4 vcheck-abs">
                                            <input type="text" name="w_copyright" size="18" value="{$data['w_copyright']?$data['w_copyright']:'律团'}"  placeholder="版权"  class="form-control" style="width: 140px;"  />
                                            <p class="text-danger">*必填</p>
                                        </div>
                                    </div>
                                    <div class="hr-line-dashed"></div>
                                    <div class="form-group panic-buy">
                                        <label class="col-sm-2 control-label">文书分类</label>
                                        <div class="col-sm-2 form-inline">
                                            <select class="form-control m-b  type-classes" name="writ_type_id" style="width: 245px;">
                                                {if condition="$data eq ''"}
                                                    {volist name="type_list" id="v"}
                                                    <option value="{$v['writ_type_id']}" >{$v['wt_name']}</option>
                                                    {/volist}
                                                {else/}
                                                    {volist name="type_list" id="v"}
                                                    <option value="{$v['writ_type_id']}" {if condition="$v['writ_type_id'] eq $data['writ_type_id']"}selected="selected"{/if}>{$v['wt_name']}</option>
                                                    {/volist}
                                                {/if}
                                            </select><p class="text-danger">*必填</p>
                                        </div>

                                    </div>

                                    <div class="hr-line-dashed"></div>
                                    <div class="form-group">
                                        <label class="col-sm-2 control-label">文书描述</label>
                                        <div class="col-sm-6 vcheck-abs">
                                            <textarea class="form-control" name="w_describe"  placeholder="文书描述" datatype="*" errormsg="请输入文书描述" sucmsg=" " >{$data['w_describe']?$data['w_describe']:''}</textarea>
                                        </div>
                                        <p class="text-danger">*必填</p>
                                    </div>
                                    
		                                       
		                            <div class="hr-line-dashed"></div>
		                            <div class="form-group panic-buy">
		                                <label class="col-sm-2 control-label">是否发布</label>
		                                <div class="col-sm-4 vcheck-abs form-inline">
                                            {if condition="$data eq ''"}
                                            <label class="gray-label ">是&nbsp;&nbsp;&nbsp;&nbsp;<input type="radio" class="form-control" name="w_state" value="2"  /></label>
                                            <label class="gray-label ">否&nbsp;&nbsp;&nbsp;&nbsp;<input type="radio" class="form-control" name="w_state" value="1" checked/></label>
                                            {else /}
                                            <label class="gray-label ">是&nbsp;&nbsp;&nbsp;&nbsp;<input type="radio" class="form-control" name="w_state" value="2"  {if condition="$data['w_state'] eq 2"}checked{/if}/></label>
                                            <label class="gray-label ">否&nbsp;&nbsp;&nbsp;&nbsp;<input type="radio" class="form-control" name="w_state" value="1" {if condition="$data['w_state'] eq 1"}checked{/if}/></label>

                                            {/if}
		                                  </div>
		                            </div> 
                                     
                                    <div class="form-group">
                                        <label class="col-sm-2 control-label">排序</label>
                                        <div class="col-sm-4 vcheck-abs">
                                           <input type="text" name="w_sort" size="18" value="{$data['w_sort']?$data['w_sort']:'0'}"  placeholder="新闻时间"  class="form-control" style="width: 140px;"  />
                                            <p class="text-danger">*必填</p>
                                        </div>
                                    </div>                                  


                               <!--     <div class="hr-line-dashed"></div>
                                    <div class="form-group">
                                        <label class="col-sm-2 control-label">显示图</label>
                                        <div class="col-sm-10">
                                            <div class="upload-pic-item">
                                                <div class="upload-pic square-min" style="width:150px;">
                                                    <div class="pic-wrap">
                                                        {if condition="$data eq ''"}
                                                            <img src="__PUBLIC__/Images/img.jpg" alt="" />
                                                        {else /}
                                                            {if condition="$data['w_writ_img'] eq ''"}
                                                            <img src="__PUBLIC__/Images/img.jpg" alt="" />
                                                            {else/}
                                                            <img src="{$data['w_writ_img']}" alt="" />
                                                            {/if}
                                                        {/if}
                                                    </div>
                                                    <div class="upload-btn">上传</div>
                                                    <div class="delete-pic-btn">删除</div>
                                                    <input class="pic-url" type="hidden" name="w_writ_img" value="{$data['w_writ_img']?$data['w_writ_img']:''}" size="600,600" />
                                                </div>
                                            </div>
                                           <p class="text-danger">*必填;图片尺寸600*600</p>
                                        </div>
                                    </div>-->

                                    <div class="hr-line-dashed"></div>
                                    <div class="form-group">
                                        <label class="col-sm-2 control-label">文书文档上传</label>
                                        <div class="col-sm-4 vcheck-abs">
                                            <input type="file" class="form-control"  style="float: right;" name="file" />
                                        </div><font color="red">{$data['w_writ_url']?$data['w_writ_url']:''}</font>
                                    </div>

                             <div class="form-group">
                                <div class="text-center">
                                    <input type="submit"  class="btn btn-danger naldffa" value="确认提交"  />
                                    <input type="hidden" name="writ_id"  value="{$data['writ_id']?$data['writ_id']:''}"/>
                                    <a class="mg-left-10 btn btn-white" href="javascript:location.reload();" alt="重置">重置</a>
                                </div>
                            </div>
                        </form>
                    </div>
                </div>
    </div>

</body>
</html>
{include file="include:js" /}
<script type="text/javascript" src="__PUBLIC__/Js/jquery.form.min.js"></script>
<script type="text/javascript">
    $(document).ready(function(){
        $('.naldffa').click(function(){
            if( $(".valid-form").Validform().check() == false ){
                return;
            };
          var  layerindex = layer.load(1, {
                shade: [0.1,'#000'] //0.1透明度的白色背景
            });
        });
        $('#uploadForm').ajaxForm({
            dataType: 'json',
            success: processJson
        });
        function processJson(data){
            var  layerindex = layer.load(1, {
                shade: [0.1,'#000'] //0.1透明度的白色背景
            });
            layer.close(layerindex);
            layer.msg(data.msg,{time: 1500});
            if(data.code == '202'){
                window.location.href = data.url;
            }
        }

    });
</script>